<?php

include_once( TOptions::serverCoreLibFile( 'blowfish.php' ) );

class TCrypt
{
    public  $key;
    
    private $crypter;
    
    function __construct( $aKey )
    {
        $this->key = $aKey;
        $this->crypter = new Blowfish( $aKey );
    }
    
    function encrypt( &$aData )
    {
        $Result = $this->crypter->encrypt( $aData );
        return $Result;
    }
    
    function decrypt( &$aData )
    {
        $Result = $this->crypter->decrypt( $aData );
        return $Result;
    }
}

/*$c = new Blowfish( 'aaaaaaa' );
$s = $c->escape( 'mama' );
echo "$s\n";
$s = $c->unescape( $s );
echo "$s\n";*/

/*$c = new Blowfish( 'aaaaaaa' );
$s = 'mama';
$s = $c->encrypt( $s );
echo ">>>> $s\n";
$s = $c->decrypt( $s );
echo $s."\n";*/

?>